/*CopyRight 2015 By YXKJ Co., Ltd. All Rights Reserved.*/
package com.yx.system;

import org.springframework.context.ApplicationContext;

/**
 * @author zgq
 */
public class SystemContext {
	private static SystemContext INSTANCE = new SystemContext();

	private SystemContext() {
	}

	public static SystemContext getInstance() {
		return INSTANCE;
	}

	private ApplicationContext applicationContext;

	/**
	 * 设置 applicationContext
	 * 
	 * @param applicationContext
	 */
	public void setApplicationContext(ApplicationContext applicationContext) {
		this.applicationContext = applicationContext;
	}

	public Object getResourceBean(String arg0) {
		return applicationContext.getBean(arg0);
	}

	public <T> T getResourceBean(Class<T> arg0) {
		return applicationContext.getBean(arg0);
	}

	public <T> T getResourceBean(String arg0, Class<T> arg1) {
		return applicationContext.getBean(arg0, arg1);
	}

	public Object getResourceBean(String arg0, Object... arg1) {
		return applicationContext.getBean(arg0, arg1);
	}
}
